package com.tech.connect.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

import com.tech.connect.R;

public class EditIntNumActivity extends BaseActivity {

    private EditText etContent;
    private String data;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getHeadBar().setRightText("完成", new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                data = etContent.getText().toString().trim();
                if (isEmpty(data)) {
                    showToast("请输入内容");
                    return;
                }
                Intent intent = new Intent();
                intent.putExtra("data", data);
                setResult(RESULT_OK, intent);
                destroyActivity();
            }
        });
        setContentView(R.layout.activity_edit_num_int);
        getHeadBar().setTitle("");
        Intent intent = getIntent();
        data = intent.getStringExtra("data");
        initView();
        etContent.setText(data);
        etContent.setSelection(etContent.getText().length());
    }

    private void initView() {
        etContent = findViewById(R.id.etContent);
    }
}